$(function(){ 
	init();
}); 
function init(){
	var newmessage = "";
	var newMessage_id = $("#newmessage_id").val();
	$.ajax({
	   	 type : "post",
	        url : "/TeaCulture/newmessage/do",
	        data : {"newmessage_id" : newMessage_id },
	        dataType : "json",
	        traditional : true,
	        success : function(result){
	       	 if(result.result.code === "1"){
	       		var j = parseInt(result.newmessage.newmessage_create_dt);
	       		var newDate = new Date();
	       		newDate.setTime(j);
	       		newmessage += "<h2>"+result.newmessage.newmessage_title+"</h2><br><smail>"+result.newmessage.newmessage_author+"</smail>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <smail>"+newDate.toLocaleString()+"</smail>";
	       		newmessage += "<br>"+result.newmessage.newmessage_content;
	       		
	       		$("#showNewMessage").append(newmessage);
	       		$("#pageView").html(result.pageView);
	        	$("#addLike").html(result.addLikeCount);
	        	$("#addstamp").html(result.addstampCount);
	       	 }else{
	       		 alert(result.result.des);
	       	 }
	       	
	       },    
	       error : function(result){
	    	  alert(result.result.des);
	       }
	});
}
function addlike(newmessageId){
	$.ajax({
	   	 type : "post",
	        url : "/TeaCulture/newmessage/addlike",
	        data : {"newmessageId" : newmessageId },
	        dataType : "json",
	        traditional : true,
	        success : function(result){
	        	$("#addLike").html(result.addLikeCount);
	       },    
	       error : function(result){
	    	  alert(result.result.des);
	       }
	});
}
function addstamp(newmessageId){
	$.ajax({
	   	 type : "post",
	        url : "/TeaCulture/newmessage/addstamp",
	        data : {"newmessageId" : newmessageId },
	        dataType : "json",
	        traditional : true,
	        success : function(result){
	        	$("#addstamp").html(result.addstampCount);
	       },    
	       error : function(result){
	    	  alert(result.result.addstampCount);
	       }
	});
}
